<?php

namespace App\Console\Commands\Tools\SystemNotify;


use App\Models\Activity\ShopOrderActivityModel;
use App\Remote\Rms\RmsUserRemote;
use App\Service\Activity\ShopOrderActivityService;
use App\Service\System\SystemNotifyService;
use App\Service\WorkOrder\Appraise\NotifyService;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Console\Command;

class PersonnelFileMissMsg extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'tools:system_notify:personnelFileMissMsg';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '工具类:消息通知:人员档案缺失通知';

    /**
     * @throws GuzzleException
     */
    public function handle()
    {
        $messageId = 147388;

        $list = RmsUserRemote::getProblemShopStaffList();

        $userIds = [];
        foreach ($list as $value) {
            $userIds = array_merge($userIds, $value['userIds']);
        }
        $userIdList = array_values(array_unique($userIds));

        SystemNotifyService::preSend($messageId, $userIdList);

    }
}
